<%= form_for [@post, @post.comments.build] do |f| %>
  <% if @comment %>
    <% if @comment.errors.any? %>
      <div id="error_explanation">
        <h2><%= pluralize(@comment.errors.count, "error") %> prohibited this post from being saved:</h2>

        <ul>
        <% @comment.errors.full_messages.each do |message| %>
          <li><%= message %></li>
        <% end %>
        </ul>
      </div>
    <% end %>
  <% end %>

  <p>
    <%= f.label :name %><br>
    <%= f.text_field :author %>
  </p>
  <p>
    <%= f.label :text %><br>
    <%= f.text_area :text %>
  </p>
  <%= f.submit %>
<% end %>
